<?php
$this->breadcrumbs=array(
	'Users'=>array('index'),
	'Manage',
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('user-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Manage Users</h1>
<?php 
	$this->widget('zii.widgets.CMenu',array(
	'items'=>array(	
		array('label'=>'Create User', 'url'=>array('create')),
		)
	));
?>

<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'user-grid',
	'dataProvider'=>$model->search(),
	//'filter'=>$model,
	'columns'=>array(
		'ID',
		'username',
		'fullname',
		array(
		'name'=>'active',
		'value'=>'$data->getYesNo($data->active)'
		),						
		array(
		'name'=>'createdate',
		'value'=>'date("d-m-Y G:i",$data->createddate)'
		),
		array(
		'name'=>'modifieddate',
		'value'=>'date("d-m-Y G:i",$data->modifieddate)'
		),
		array(
		'name'=>'status',
		'value'=>'$data->getUserStatus($data->status)'
		),	
		
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>
